<%@page import="com.pks.autoInsurance.dto.CustomerDto"%>
<%@page import="com.pks.autoInsurance.dto.VehicleDto,java.util.Map"%>
<html>
<head>
<title>Final Quotation</title>
<jsp:include page="header.jsp" />
<script>
	window.history.forward(1);
</script>
</head>
<body>
	<fieldset>
		<legend>Final Quotation</legend>

		<table>
			<%
				Object object = null;
					VehicleDto vehicleDto = null;
					CustomerDto registrationDto = null;
					Map<String, Object> map = null;
					if ((object = request.getAttribute("quote")) instanceof Map) {
						map = (Map<String, Object>) object;
						if ((object = map.get("vehicleInfo")) instanceof VehicleDto) {
							vehicleDto = (VehicleDto) object;
						}
						if ((object = map.get("userInfo")) instanceof CustomerDto) {
							registrationDto = (CustomerDto) object;
						}
					}
			%>
			<tr>
				<td>Name</td>
				<td><%=registrationDto.getFirstName()+" " +registrationDto.getLastName()%></td>
			</tr>
			<tr>
				<td>SSN</td>
				<td><%=vehicleDto.getSsn()%></td>
			</tr>
			<tr>
				<td>Make</td>
				<td><%=vehicleDto.getMake()%></td>
			</tr>
			<tr>
				<td>Model</td>
				<td><%=vehicleDto.getModel()%></td>
			</tr>
			<tr>
				<td>Vehicle Reg No.</td>
				<td><%=vehicleDto.getRegNo()%></td>
			</tr>

		</table>
	</fieldset>
	<fieldset>
		<legend> Premium Summary </legend>
		<table>
			<tr>
				<td>Coverage Type</td>
				<td><%=vehicleDto.getPolicyType()%></td>
			</tr>
			<tr>
				<td>Coverage Amount</td>
				<td><%="$ " + vehicleDto.getPolicyAmount()%></td>
			</tr>
			<tr>
				<td>Monthly</td>
				<td><%="$ " + map.get("premiumMonthly")%></td>
			</tr>
			<tr>
				<td>Quarterly</td>
				<td><%="$ " + map.get("premiumQuarterly")%></td>
			</tr>
			<tr>
				<td>Annually</td>
				<td><%="$ " + map.get("premiumAnnually")%></td>
			</tr>
			<tr />
			<tr>
				<td />
				<td><img src="template/images/print_f2.png"
					onclick="window.print()" alt="Print" title="Click to print" /></td>
			</tr>
		</table>
	</fieldset>
	<jsp:include page="footer.jsp" />
</body>
</html>